<script setup>
import {ref,computed} from 'vue'

const num1 = ref(0)
const num2 = ref(0)

//计算属性
const autoSum = computed(()=>{
    return num1.value + num2.value
})
</script>

<template>
<div>
<input type="number" v-model.number.lazy="num1"> + 
<input type="number" v-model.number.lazy="num2"> = 
<span>
    {{ autoSum }}
</span>
</div>
</template>